<template>
	<view class="container">
	

		
			<view class="bgWhite pb15 boxshadow20">
				<view class="flex align-center  coursedata ">
					<image src="../../static/images/img_internet.png" mode=""></image>
					<view class="flex1 flex-col justify-between " style="height: 236rpx">
						<view class="clamp2 title">
							{{detail.title}}
						</view>
						<text>学时：{{detail.xueshi}}</text>
						<view class="flex1">

						</view>
						
					</view>
				</view>

	
				<view class="align-center justify-between menudata">
				<image src="/static/images/info.png" style="width: 50rpx;" class="mr5" mode="widthFix"></image>
					
				<view class="" style="width: 120rpx;">
						网络进度:
				</view>  
				<view class="mlr15" style="flex: 1;" >
						<uv-line-progress :percentage="detail.totalJindu" activeColor="#0082DB"></uv-line-progress>
				</view>
				<view class="">
						<text style="color: #0082db;"> {{detail.totalJindu}}</text>/<text>15</text>
				</view>
				</view>
				<view class="align-center justify-between menudata">
					<image src="/static/images/info.png" style="width: 50rpx;" class="mr5" mode="widthFix"></image>
				<view class="" style="width: 120rpx;">
						总进度: 
				</view>  
				<view class="mlr15" style="flex: 1;" >
						<uv-line-progress :percentage="detail.totalJindu" activeColor="#0082DB"></uv-line-progress>
				</view>
				<view class="">
						<text style="color: #0082db;"> {{detail.totalJindu}}</text>/<text>15</text>
				</view>
				</view>
				<view class="justify-between align-center plr10">
					<view class="align-center justify-between plr15 ptb10 ft12  radius8" style="background-color: rgba(0, 130, 219,.1);">
						开始: <text style="color: #0082db;">  {{detail.starttime}}</text>
					</view>
					<view class="align-center justify-between plr15 ptb10 ft12 radius8" style="margin-bottom: 0;background-color: rgba(245, 108, 108,.3);">
						截至: <text style="color:rgb(245, 108, 108) ;">  {{detail.endtime}}</text>
					</view>
				</view>
				
			</view>
			<view class="mt15 mlr15 bgWhite radius10 boxshadow20 pb15 plr15 pt15">
				<view class="plr15 pt15 pb15 learndata" @click="ToMain" >
					<view class="">
						在线学习
					</view>
					<view style="font-size: 24rpx;" class="mt5 mb5">总共{{detail.xueshi}}学时</view>
					<uv-line-progress :percentage="100" activeColor="#fff"></uv-line-progress>
				</view>
				<view class="plr15 ptb15 ziliaodata" @click="" style="">
					<view class="">
						查看学习资料
					</view>
					<view class="mt10">
						<text>学习资料：</text> (图片或者doc,xls,ppt文件)
					</view>
				</view>
			</view>
		
		
		

	</view>
</template>

<script>
	let app = getApp();
	export default {
		components: {

		},
		data() {
			return {
				act: 0,
				id:"",
				detail:{},
				isLogin:uni.getStorageSync('logintoken'),
				muluList:[]
			}
		},
		onLoad(opt) {
			
			if(opt.id){
				this.id =opt.id
				this.getDetail()
			}

		},
		mounted() {



			// 使用函数生成一个正弦波形


		},

		methods: {
			learn(){
					
				if(this.isLogin){
					uni.navigateTo({
						url:'/pages/confirm/index?id='+this.id
					})
				}else{
					uni.reLaunch({
						url:'/pages/login/login'
					})
				}
			},
			getDetail(){
				this.$api.getDetailInfo({id:this.id}).then(res=>{
					console.log(res)
					this.detail =res.data
				})
				
				
			},
			open(e){
				console.log(e)
				this.$api.getContent({id:this.muluList[e].id}).then(res=>{
					
					this.muluList[e]={
						...this.muluList[e],
						...{
							classlist:res.data
						}
					}	
						console.log(this.muluList)
					
				})
			},
			ToMain(item){
				uni.navigateTo({
					url:'/pages/playVideo/index?id='+this.id 
				})
			}
			
			
		}





	}
</script>
<style scoped lang="scss">
	page {
		color: #343434;
	}

	.header {
		width: 100%;
		height: 110rpx;
		background-color: #fff;

		box-sizing: border-box;
		color: #969696;
		position: fixed;
		top: 88rpx;
		left: 0;
		z-index: 999;
		display: flex;

		view {
			text-align: center;
			font-size: 28rpx;
			height: 100%;
			display: flex;
			align-items: center;
			justify-content: center;
		}

		.on {
			color: #000;
			position: relative;
		}

		.on::after {
			content: "";
			width: 20rpx;
			height: 4rpx;

			background: #0082DB;
			position: absolute;
			bottom: 0;
			left: 0;
			right: 0;
			margin: auto;

		}

		.middle {
			position: relative;
		}

		.middle::after {
			content: "";
			width: 2rpx;
			height: 30rpx;
			background: #E0E0E0;
			position: absolute;
			top: 0;
			bottom: 0;
			margin: auto;
			right: 0;
		}

		.middle::before {
			content: "";
			width: 2rpx;
			height: 30rpx;
			background: #E0E0E0;
			position: absolute;
			top: 0;
			bottom: 0;
			margin: auto;
			left: 0;
		}
	}



	.tag {
		background-color: rgb(255, 219, 109);
		color: #fff;
		font-size: 26rpx;
		padding: 4rpx 8rpx;
		border-radius: 10rpx;
		margin-right: 10rpx;
	}

	.coursedata {
		padding: 20rpx;
		color: #969696;
		font-size: 24rpx;

		image {
			width: 300rpx;
			height: 236rpx;
			border-radius: 15rpx;
			margin-right: 20rpx;
		}

		.title {
			font-size: 33rpx;
			color: #000;
			margin-bottom: 10rpx;
		}

		.price {
			font-weight: bold;
			color: #1FACFF;
			font-size: 42rpx;
		}
	}

	.menudata {
		margin: 20rpx;
		height: 72rpx;
		border: 1px solid #cad9fe;
		font-size: 28rpx;
		border-radius: 10rpx;
		padding: 0 20rpx;
	}

	.moduletitle {
		height: 116rpx;

		text {

			width: 6rpx;
			height: 18rpx;
			background: #0082DB;
			border-radius: .5rem;
			display: block;
		}
	}

	.maininfo {
		border-top: 2rpx solid #E0E0E0;


	}

	.submit {
		width: 700rpx;
		padding: 20rpx;
		height: 140rpx;
		border-radius: 20rpx;
		position: fixed;
		left: 0;
		right: 0;
		margin: auto;
		bottom: 40rpx;
	}

	.logbtn {
		background: linear-gradient(180deg, #98D5FF 0%, #0082DB 100%);
		border-radius: 20rpx;
		width: 100%;
		height: 100rpx;
		text-align: center;
		line-height: 100rpx;
		color: #fff;
	}
	.slottitle{
		font-size: 34rpx;
		color: #343434;
		image{
			width: 56rpx;
			height: 56rpx;
		}
	}
	.contentbox{
		border: 1px solid #E0E0E0;
		border-radius: 15rpx;
		padding:10rpx 20rpx;
		font-size: 24rpx;
	}
	.contentTitle{
		width: 147rpx;
		height: 84rpx;
		// background-image: url('../../static/images/bg6.png');
		background-size: 100% 100%;
		margin-right: 20rpx;
		text-align: center;
		line-height: 84rpx;
		color: #0082DB;
	}
	.learndata{
		background-image: url('/static/images/redbg.png');
		background-size: 100% 100%;
		height: 160rpx;
		color: #fff;
	}
	.ziliaodata{
		height: 160rpx;
	background-image: url('/static/images/blbg.png');
	background-size: 100% 100%;
	color: #fff;
	margin-top: 20rpx;
	}
	// /deep/.uv-collapse-item__content{
	// 	height: auto!important;
	// }
</style>